function [residual] = predict2(time_chunk, chunk_size)

[file_name, file_path] = uigetfile('../stats/*', 'Load Test Data');

wrist_data =  csvread(fullfile(file_path, file_name));
wrist_data = wrist_data((time_chunk - 1) * chunk_size/2 + 1:(time_chunk - 1) * chunk_size/2 + chunk_size, :);
wrist_data = mean(wrist_data, 1);

time_step = wrist_data(:,1);
weight = wrist_data(:,2);
mu = wrist_data(:,3);
force = wrist_data(:,4:6);
torque = wrist_data(:,7:9);
pos = wrist_data(:,10:12);
quat = wrist_data(:,13:16);
status = wrist_data(:,17);
con_force = wrist_data(:, 18:20);

X = [force torque pos quat status con_force]
Y = [weight mu]

X = zscore(X);
% Y = zscore(Y)


BETA = csvread(fullfile(file_path, '../..', 'plsr', [num2str(time_chunk) '.csv']))
Y_hat = [ones(size(X,1),1) X] * BETA
residual = Y - Y_hat;

stem(residual);
xlabel('Observation');
ylabel('Residual');

end

